<style lang="sass" scoped>
    .logo{
        margin:140px auto 0;
        display:block;
    }
    .title{
        margin-top:150px;
        text-align:center;
        font-size:30px;
    }
    .login{
        width:500px;
        margin:50px auto;
        .group{
            margin-bottom:30px;
            align-items:center;
            .label{
                width:50px;
                font-size:24px;
            }
            input{
                flex:1;
                border:1px solid #ccc;
                background:#bebebe;
                padding:10px;
                font-size:24px;
            }
        }
    }
    .login-btn{
        width:160px;
        height:60px;
        line-height:60px;
        text-align:center;
        background:rgb(255, 95, 95);
        color:#fff;
        font-size:24px;
        border-radius:20px;
        margin:0 auto;
    }
</style>
<template>
    <div class="container">
        <!-- <img class="logo" src="../../assets/images/home/logo.png" alt=""> -->
        <div class="title">分销管理平台</div>
        <div class="login">
            <div class="group flex">
                <div class="label">账号</div>
                <input v-model.trim="post.account" type="text">
            </div>
            <div class="group flex">
                <div class="label">密码</div>
                <input v-model.trim="post.pwd" type="password">
            </div>
            <div @click="login()" class="login-btn">登陆</div>
        </div>
    </div>
</template>
<script>
    export default {
        components: {
        },
        data() {
            return {
                post:{
                    account:'',//	是	string	账号
                    pwd:'',//	是	string	密码
                }
            };
        },
        watch:{
        },
        created(){

        },
        mounted() {
            this.$nextTick(() => {
                 
            });
        },
        methods: {
            login(){
                let param = JSON.parse(JSON.stringify(this.post));
                if(param.account===''){
                    popup.alert({content:'请输入账号'})
                    return;
                }
                if(param.account===''){
                    popup.alert({content:'请输入密码'})
                    return;
                }
                util.ajax({
                    url:config.baseApi + 'bookMall-dms/api/login/login',
                    data:param,
                    success:(data=>{
                        util.setCookie('dmsToken',data.data.token,7);
                        util.setCookie('userMsg',JSON.stringify(data.data));
                        location.href="/"
                    })
                })
            }
        },
        
    };
</script>